import request from '@/utils/request'

export function getList(page, limit, housingQuery) {
  return request({
    url: `/dormitory/housing/list/${page}/${limit}`,
    method: 'post',
    data: housingQuery
  })
}

export function getHousing(id) {
  return request({
    url: `/dormitory/housing/getHousing/${id}`,
    method: 'get'
  })
}

export function save(housing) {
  return request({
    url: `/dormitory/housing/save`,
    method: 'post',
    data: housing
  })
}

export function update(housing) {
  return request({
    url: `/dormitory/housing/update`,
    method: 'post',
    data: housing
  })
}

export function remove(id) {
  return request({
    url: `/dormitory/housing/remove/${id}`,
    method: 'delete'
  })
}

export function buildingList() {
  return request({
    url: `/dormitory/building/buildingList`,
    method: 'get'
  })
}

export function floorList() {
  return request({
    url: `/dormitory/building/floorList`,
    method: 'get'
  })
}

export function floorListById(id) {
  return request({
    url: `/dormitory/building/floorListById/${id}`,
    method: 'get'
  })
}
